package main

import (
	"fmt"
	"./goquery"
	"os"
	"log"
)

func GetJoker() {
	file := "news.txt"
	fout, err := os.Create(file)
	defer err!=nil {
		fmt.Println(file,err)
		return
	}
	doc, err := qoquery.NewDocument("http://news.qq.com")
	if err != nil {
		log.Fatal(err)
	}
	doc.Find(".linkto").Each(func(i int, s *qoquery.Selection) {
		fout.WriteString(s.Text())
		fout.WriteString("\n")
	})
}

func main() {
	GetJoker()
}